<?php
/**
 * spsNewsletter controller for configuration
 * 
 * @author Satyan Shah <joomlaDesign@modernbridge.com>
 * @link http://www.modernbridge.com
 * @license GNU/GPL
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();

class spsNewslettersControllerspsNewsletterConfig extends spsNewslettersController
{
	/**
	 * constructor (registers additional tasks to methods)
	 * @return void
	 */
	function __construct()
	{
		parent::__construct();

	}

	// save configuration settings
	function save()
	{
		// get model
		$model = $this->getModel('spsNewsLetterConfig');
		
		// store settings and redirect accordingly
		if ($model->store($post)) {
			$msg = JText::_( 'Configuration Settings Updated!' );
		} 
		else {
			$msg = JText::_( 'Error Saving Configuration Settings' );
		}
		
		// redirect
		$link = 'index.php?option=com_spsNewsletter&controller=spsNewsletterConfig';
		$this->setRedirect($link, $msg);
	}

	// cancel
	function cancel()
	{
		// set message and redirect back
		$msg = JText::_( 'Operation Cancelled' );
		$this->setRedirect( 'index.php?option=com_spsNewsletter&controller=spsNewsletterConfig', $msg );
	}
}
?>
